<!--公共开始-->
<include file='./header' />
<!--公共结束-->
<title>7min理财</title>
<script type="text/javascript" src="__ROOT__/js/highstock.js"></script>
<script type="text/javascript" src="__ROOT__/js/highcharts-zh_CN.js"></script>
<script type="text/javascript" src="__ROOT__/js/dist/echarts.js"></script>
<script type="text/javascript">

$(function() {
    tabs(".cat_m_tab","on",".cat_m_con");
	$('.cat_m_tab a:first').attr("class","on");
    lineshow(1,{$product['innercode']});
	$('#pie').highcharts({
			chart: {
			},
			title: {
				text: null,
				style: { "color": "#ff6c60", "fontSize": "16px" ,"fontFamily":"微软雅黑"}		
			},
			tooltip: {
				pointFormat: '{series.name}: <b>{point.percentage:.2f}%</b>'
			},
			plotOptions: {
				pie: {
					allowPointSelect: true,
					cursor: 'pointer',
					dataLabels: {
						enabled: false,
					},
					showInLegend: true,
					innerSize: '50%'
				},
			},
			legend: {
					layout: 'horizontal',
					align: 'center',
					borderWidth: 0,
					itemWidth: 60,
					itemMarginTop: 10,
					width:240,
					itemStyle : { 'fontWeight' : 'normal' },
					floating: false,				
					},
			series: [{
				type: 'pie',
				name: '占比',
				data: [
					{name: '现金', y:<?php echo $fund['assetTypeCash']?>,color: '#ff6c60' },
					{name: '债券', y: <?php echo $fund['assetTypeBond']?>,color:'#fcb322' },
					{name: '股票', y: <?php echo $fund['assetTypeStock']?>,color: '#a9d86e' },
					{name: '另类', y: <?php echo $fund['assetTypeOther']?>,color:'#58c9f3'}
				]
			}]
		});
});

var datestr = new Array();
var valuestr = new Array();
function lineshow(t,c){
     if(datestr != null){
         datestr.length = 0; 
     }
      if(valuestr != null){
         valuestr.length = 0; 
     }
     $.ajax({  
        type: "post",  
        url: "__URL__/gettimevalue",
        dataType: 'json',
        async: false,
        data: {t:t,c:c}, 
        beforeSend: function(XMLHttpRequest){
        },  
        success: function(json){
            if(json != null)
            {
                $.each(json.data, function (n, value) {  
                     datestr.push(value.enddate);
                     valuestr.push(value.unitnv);
                 });
                 // 路径配置
                require.config({
                    paths: {
                        echarts: '__ROOT__/js/dist'
                    }
                });
                 // 使用
                require(
                    [
                        'echarts',
                        'echarts/chart/line' // 使用柱状图就加载bar模块，按需加载
                    ],
                function (ec) {
                        // 基于准备好的dom，初始化echarts图表
                        var myChart = ec.init(document.getElementById('main')); 
                        //myChart.showLoading({
                        //    animation:false,
                        //    text: "图表数据正在努力加载..."
                        //});
                        var option = {
                            title : {
                                text: '{$fund['ChiName']}',
                                subtext: '单位净值走势'
                            },
                            tooltip : {
                                trigger: 'axis'
                            },
                            legend: {
                                data:['单位净值走势']
                            },
                            toolbox: {
                                show : false,
                                feature : {
                                    mark : {show: true},
                                    dataView : {show: true, readOnly: false},
                                    magicType : {show: true, type: ['line', 'bar']},
                                    restore : {show: true},
                                    saveAsImage : {show: true}
                                }
                            },
                            calculable : true,
                            xAxis : [
                                {
                                    type : 'category',
                                    boundaryGap : false,
                                    data : datestr
                                }
                            ],
                            yAxis : [
                                {
                                    type : 'value',
                                    axisLabel : {
                                        formatter: '{value} %'
                                    }
                                }
                            ],
                            series : [
                                {
                                    name:'单位净值走势',
                                    type:'line',
                                    symbol: 'none',
                                    data: valuestr,
                                    markPoint : {
                                        data : [
                                            {type : 'max', name: '最大值'},
                                            {type : 'min', name: '最小值'}
                                        ]
                                    },
                                    /*itemStyle:{  
                                        normal:{  
                                            color:'#C00E53'
                                        }
                                    },*/
                                    itemStyle: {
                                        normal: {
                                            color:'#C00E53',
                                            areaStyle: {
                                                // 区域图，纵向渐变填充
                                                color : (function (){
                                                    var zrColor = require('zrender/tool/color');
                                                    return zrColor.getLinearGradient(
                                                        0, 200, 0, 400,
                                                        [[0, 'rgba(255,0,0,0.8)'],[0.8, 'rgba(255,255,255,0.1)']]
                                                    )
                                                })()
                                            }
                                        } 
                                    }, 
                                    markLine : {
                                        data : [
                                            {type : 'average', name: '平均值'}
                                        ]
                                    }
                                }
                            ]
                        };
                        // 为echarts对象加载数据 
                        myChart.setOption(option); 
                    }
                );
                 
            }
        }       
    }) 
}
</script>
</head>

<body>
<!--顶部开始-->
<include file="./top" />
<!--顶部结束-->
<!--左导航开始-->
<include file="./left" />
<!--左导航结束-->->
<!--主体开始-->
    <div class="main-content">
     <div class="wrapper">
		<!--<div class="left25 left">
        	<div class="panel">
            	<div class="panel-body">
                    <div class="recommend_left">
                        <img src="__ROOT__/images/con_cat.jpg"  />                    
                    </div>
                    <div class="bdsharebuttonbox">
                        <span class="left" style="margin: 5px 6px 6px 0;">分享到：</span><a href="#" class="bds_more" data-cmd="more"></a><a title="分享到微信" href="#" class="bds_weixin" data-cmd="weixin"></a><a title="分享到新浪微博" href="#" class="bds_tsina" data-cmd="tsina"></a><a title="分享到QQ空间" href="#" class="bds_qzone" data-cmd="qzone"></a><a title="分享到腾讯微博" href="#" class="bds_tqq" data-cmd="tqq"></a><a title="分享到人人网" href="#" class="bds_renren" data-cmd="renren"></a>
                    </div>
                    <script type="text/javascript">
                    window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"1","bdSize":"16"},"share":{},"image":{"viewList":["weixin","tsina","qzone","tqq","renren"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["weixin","tsina","qzone","tqq","renren"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
                    </script>
                </div>
            </div>
        </div>-->
        <div class="">
            <!--涨跌数据-->
            <div class="panel">
            	<div class="panel-head cat_table1">
                	<h1>
                        <span style="width:38%;">{$fund['ChiName']}</span>
                        <span style="width:38%;">代码：{$fund['tradecode']}</span>
                        <span>{$fund['FundType']}</span>
                    </h1>
                </div>
                <div class="panel-body">
                    <div class="cat_data">
                        <div class="cat_cell align-center" style="width:30%;"><b class="text-danger">{$fund['lastdayreturn']}%</b><br>近一日</div>
                        <div class="cat_cell align-center" style="width:30%;"><b class="text-danger">{$fund['lastyearreturn']}%</b><br>近一年 </div>
                        <div class="cat_cell align-center"><b class="text-black">{$product['minmoney']}元</b><br>最少起购额</div>
                    </div>
                    <hr>
                    <div class="cat_comment">
                    	<span class="text-danger">评论：</span>{$product['comment']}
                    </div>
                </div>
            </div>
            <div class="cat_m_tab align-right" style="margin-bottom:30px;">
                    <a href="#" onclick="lineshow(1,{$product['innercode']})" class="on">1个月</a>
                    <a href="#" onclick="lineshow(2,{$product['innercode']})">3个月</a>
                    <a href="#" onclick="lineshow(3,{$product['innercode']})">6个月</a>
                    <a href="#" onclick="lineshow(4,{$product['innercode']})">1年</a>
                    <a href="#" onclick="lineshow(5,{$product['innercode']})">3年</a>
                    <a href="#" onclick="lineshow(6,{$product['innercode']})">今年来</a>
                    <a href="#" onclick="lineshow(7,{$product['innercode']})">最大</a>
            </div>
            <div id="main" style="height:400px"></div>
            <!--基金详情-->
            <div class="panel">
                <div class="panel-body">
                    <div class="side-item">
                        <h1><span>基金详情</span></h1>
                    </div>
                    <!--曲线图-->
                    <!--<div class="cat_manager"><h2><i class="fa fa-line-chart text-danger"></i>收益走势图</h2></div>
                    <div class="spline" id="spline" style="width:100%;height:400px"></div>-->
                    <!--统计-->
                    <div class="cat_count">
                    	<table class="table table-hover table-striped">
                          <thead>
                              <tr>
                                <th>&nbsp;</th>
                                <th>今年以来</th>
                                <th>3月</th>
                                <th>6月</th>
                                <th>1年</th>
                                <th>2年</th>
                                <th>3年</th>
                                <th>5年</th>
                                <th>总回报</th>
                                <th>年化回报</th>
                              </tr>
                          </thead>
                          <tbody>
                              <tr>
                                <td><?php echo $fund['ChiName'];?></td>
                                <td><?php echo $fund['thisYearValue'];?></td>
                                <td><?php echo $fund['threeMonthValue'];?></td>
                                <td><?php echo $fund['sixMonthValue'];?></td>
                                <td><?php echo $fund['oneYearValue'];?></td>
                                <td><?php echo $fund['twoYearValue'];?></td>
                                <td><?php echo $fund['threeYearValue'];?></td>
                                <td><?php echo $fund['fiveYearValue'];?></td>
                                <td><?php echo $fund['totalReturnValue'];?></td>
                                <td><?php echo $fund['yearReturnValue'];?></td>
                                
                              </tr>
                              
                              <tr>
                                <td><?php echo $fund['referName'];?></td>
                                <?php foreach ($fund['referdata'] as $m => $n){?>
                                <td><?php echo $n;?></td>
                                <?php }?>
                              </tr>
                              
                              <tr>
                                <td>同类排名</td>
                                <td><?php echo $fund['thisYear'] . '/' . $fund['thisyearTotal'];?></td>
                                <td><?php echo $fund['threeMonth'] . '/' . $fund['threeMonthTotal'];?></td>
                                <td><?php echo $fund['sixMonth'] . '/' . $fund['sixMonthTotal'];?></td>
                                <td><?php echo $fund['oneYear'] . '/' . $fund['oneYearTotal'];?></td>
                                <td><?php echo $fund['twoYear'] . '/' . $fund['twoYearTotal'];?></td>
                                <td><?php echo $fund['threeYear'] . '/' . $fund['threeYearTotal'];?></td>
                                <td><?php echo $fund['fiveYear'] . '/' . $fund['fiveYearTotal'];?></td>
                                <td><?php echo $fund['totalReturn'] . '/' . $fund['totalReturnTotal'];?></td>
                                <td><?php echo $fund['yearReturn'] . '/' . $fund['yearReturnTotal'];?></td>
                                
                              </tr>
                          </tbody>
                        </table>

                    </div>
                    <div class="clear"></div>
                    <!--环形图-->
                    <div class="cat_pie left">
                    	<div class="cat_manager"><h2><i class="fa fa-pie-chart text-danger"></i>资产占比</h2></div>
                        <div id="pie" style="width:100%;height:320px;"></div>
                    </div>
                    <!--基金经理-->
                    <div class="cat_manager right">
                    	<h2><i class="fa fa-user text-danger"></i>基金经理</h2>
                        <div class="cat_m_tab">
                        <?php foreach ($fund['Manager'] as $k => $v){?>
                        	<a href="javascript:void(0)"><?php echo $v['Name'];?></a>
						<?php }?>
                        </div>
                        <div class="cat_m_con">
                        
                        <?php foreach ($fund['Manager'] as $k => $v){?>
                        	<!--张靖-->
                            <div class="cat_m_con_one">
                            	<div class="info">
                                	<p><?php echo $v['Background'];?></p>
                                </div>
                                
                                <h2><i class="fa fa-list-alt text-danger"></i>基金经理最近任期回报</h2>
                                <table class="table">
                                  <thead>
                                      <tr>
                                        <th>基金名称</th>
                                        <th width="80px">基金类型</th>
                                        <th width="80px">起始日期</th>
                                        <th width="80px">截止日期</th>
                                        <th width="80px">任期天数</th>
                                        <th width="80px">任期回报</th>
                                      </tr>
                                  </thead>
                                  <tbody>
                                  
                                   <?php foreach ($v['workinfo'] as $m => $n){?>
                                      <tr>
                                        <td><?php echo $n['fundname'];?></td>
                                        <td><?php echo $n['fundtype'];?></td>
                                        <td><?php echo $n['startDate'];?></td>
                                        <td><?php echo $n['endDate'];?></td>
                                        <td><?php echo $n['days'];?></td>
                                        <td><?php echo $n['Performance'];?></td>
                                      </tr>
                                   <?php }?>
                                      
                                  </tbody>
                                </table>
                            </div>
						<?php }?>
                        	

                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            
            <!--基金档案-->
            <div class="panel">
                <div class="panel-body cat_file">
                    <div class="side-item">
                        <h1><span>基金档案</span></h1>
                    </div>
                    <table class="table table-bordered">
                      <tr>
                        <th width="15%">基金全称</th>
                        <td width="35%">{$fund['ChiName']}</td>
                        <th width="15%">基金类型</th>
                        <td>{$fund['FundType']}</td>
                      </tr>
                      <tr>
                        <th>基金规模</th>
                        <td>{$fund['FoundedSize']}亿</td>
                        <th>成立日期</th>
                        <td>{$fund['EstablishmentDate']}</td>
                      </tr>
                      <tr>
                        <th>基金管理人</th>
                        <td>{$fund['InvestAdvisor']}</td>
                        <th>基金托管人</th>
                        <td>{$fund['Trustee']}</td>
                      </tr>
                      <tr>
                        <th>最小申购额度</th>
                        <td>{$product['minmoney']}元</td>
                        <th>最小赎回额度</th>
                        <td>{$fund['LowestSumRedemption']}元</td>
                      </tr>

                    </table>
                </div>
            </div>
            
        </div>
        
        <div class="clear"></div>
    </div>
    </div>
<!--主体结束-->
<!--底部开始-->
<include file="./foot" />
<!--底部结束-->
</body>
</html>
